
class IO:
    def __init__(self, kernel):
        self.kernel = kernel
        
        
    def run(self, pcb):
        f = True
        pc = pcb.getProgramCounter()
        while(f):
            instr = self.kernel.memoryadmin.read(pc, pcb.getPid())
            if(instr != None and instr.typeOfIntruction()):
                pc = pc + 1
                print("1 IO Instruction passed")
            else:
                f = False
        pcb.setPc(pc)
        
        if(instr != None):
            self.kernel.reanudarPCB(pcb)  
            self.kernel.pasarAlSiguientePCB()      
        else:
            self.kernel.killPCB(pcb)
            self.kernel.pasarAlSiguientePCB()
                
        
                 
        
    
        
    